﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ExaminationSys.View.Student
{
    public partial class JoinExaminationMMShow : System.Web.UI.Page
    {
        public string sourceurl = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Page.Request.QueryString["mvurl"] != null)
                {
                    string mvurl = Page.Request.QueryString["mvurl"].ToString();
                    var host = GetHost();
                    sourceurl = String.Format("{0}/UpLoadFiles/DBQuestion/{1}", host, mvurl);
                }                    
            }
        }

        private string GetHost()
        {
            var host = "http://" + HttpContext.Current.Request.Url.Host;
            var portflag = HttpContext.Current.Request.Url.IsDefaultPort;
            host += portflag ? "" : (":" + HttpContext.Current.Request.Url.Port);

            return host;
        }
    }
}